<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="./js/is_object.js"></script>
  <script>
    function deepCopy(originValue) {
      // 如果是基本类型,直接返回
      if (!isObject(originValue)) return originValue
      // 如果是对象类型
      const newObj = {}
      for (const key in originValue) {
        newObj[key] = deepCopy(originValue[key])
      }
      return newObj
    }

    const info = {
      name: "why",
      age: 18,
      friend: {
        name: "kobe",
        address: {
          name: "洛杉矶",
          detail: "斯坦普斯中心"
        }
      }
    }
    const newObj = deepCopy(info)
    console.log(newObj)
  </script>
</body>

</html>